$(function() {
  let $nav = $('.navbar-nav.mr-auto')

  let $active = $nav.find('.active')
  $nav.on('click', '.text-link', function(event) {
    let $textLink = $(event.currentTarget)
    
    if ($textLink.is('.text-link')) {
      $active.removeClass('active')
      $textLink.addClass('active')
      $active = $textLink
    }
  })
})